package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.CertifyType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "merchant_certify")
@DynamicInsert(value = true)
@DynamicUpdate(value = true)
public class MerchantCertify extends IDEntityMall {

    @Column(columnDefinition = "varchar(255) comment '审核备注'")
    public String auditRemark;
    @Column(columnDefinition = "varchar(255) comment '企业名称'")
    public String companyName;
    @Column(columnDefinition = "varchar(255) comment '个人联系地址/办公地址'")
    public String contactAddress;
    @Column(columnDefinition = "varchar(255) comment '个人/企业联系手机号'")
    public String contactPhone;
    @Column(columnDefinition = "timestamp comment '审核时间'")
    public Date dateAudited;


    @Column(columnDefinition = "varchar(255) comment '个人/法人身份证号码'")
    public String idcardCode;

    @Column(columnDefinition = "bigint(20) comment '平台ID'")
    public Long mallId;

    @Column(columnDefinition = "varchar(255) comment '营业执照注册号'")
    public String licenseCode;



    @Column(columnDefinition = "bigint(20) comment '选择地区ID'")
    public Long locationId;
    @Column(columnDefinition = "varchar(255) comment '个人/法人真实姓名'")
    public String realName;
    @Column(columnDefinition = "varchar(255) comment '认证类型 个人:PERSONAL 企业:COMPANY'")
    @Enumerated(EnumType.STRING)
    public CertifyType type;

    @Column(columnDefinition = "varchar(255) comment '个人/企业邮箱'")
    public String email;
    @Column(columnDefinition = "varchar(255) comment '身份证正面扫描件URL'")
    private String idCardPicUrl;
    @Column(columnDefinition = "varchar(255) comment '营业执照扫描件URL'")
    private String licensePicUrl;

    @Column(columnDefinition = "bigint(20) comment '商家ID'")
    public Long merchantId;

    @Column(columnDefinition = "bigint(20) comment '用户ID'")
    public Long userInfoId;

    @Transient
    private String locationStr;

    public String getLicensePicUrl() {
        return licensePicUrl;
    }

    public void setLicensePicUrl(String licensePicUrl) {
        this.licensePicUrl = licensePicUrl;
    }

    public String getIdCardPicUrl() {
        return idCardPicUrl;
    }

    public void setIdCardPicUrl(String idCardPicUrl) {
        this.idCardPicUrl = idCardPicUrl;
    }



    public String getAuditRemark() {
        return auditRemark;
    }

    public void setAuditRemark(String auditRemark) {
        this.auditRemark = auditRemark;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getContactAddress() {
        return contactAddress;
    }

    public void setContactAddress(String contactAddress) {
        this.contactAddress = contactAddress;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }

    public Date getDateAudited() {
        return dateAudited;
    }

    public void setDateAudited(Date dateAudited) {
        this.dateAudited = dateAudited;
    }
    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }
    public String getIdcardCode() {
        return idcardCode;
    }

    public void setIdcardCode(String idcardCode) {
        this.idcardCode = idcardCode;
    }

    public String getLicenseCode() {
        return licenseCode;
    }

    public void setLicenseCode(String licenseCode) {
        this.licenseCode = licenseCode;
    }

    public Long getLocationId() {
        return locationId;
    }

    public void setLocationId(Long locationId) {
        this.locationId = locationId;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public CertifyType getType() {
        return type;
    }

    public void setType(CertifyType type) {
        this.type = type;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public void setLocationStr(String locationStr) {
        this.locationStr = locationStr;
    }

    public String getLocationStr() {
        return locationStr;
    }

    public Long getUserInfoId() {
        return userInfoId;
    }

    public void setUserInfoId(Long userInfoId) {
        this.userInfoId = userInfoId;
    }

    @Override
    public String toString() {
        return "MerchantCertify{" +
                "auditRemark='" + auditRemark + '\'' +
                ", companyName='" + companyName + '\'' +
                ", contactAddress='" + contactAddress + '\'' +
                ", contactPhone='" + contactPhone + '\'' +
                ", dateAudited=" + dateAudited +
                ", idcardCode='" + idcardCode + '\'' +
                ", mallId=" + mallId +
                ", licenseCode='" + licenseCode + '\'' +
                ", locationId=" + locationId +
                ", realName='" + realName + '\'' +
                ", type=" + type +
                ", email='" + email + '\'' +
                ", idCardPicUrl='" + idCardPicUrl + '\'' +
                ", licensePicUrl='" + licensePicUrl + '\'' +
                ", merchantId=" + merchantId +
                ", userInfoId=" + userInfoId +
                ", locationStr='" + locationStr + '\'' +
                '}';
    }
}
